#include<iostream>
using namespace std;
int n, k;
int arr[1010];
int main()
{
	int x = 0, y = 0;
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	int j = n - 1;
	for (int i = 0; i < n; i++) {
		while (i<j && arr[i] + arr[j]>k) {
			j--;
		}
		if (i < j && arr[i] + arr[j] == k) {
			x = i;
			y = j;
			break;
		}
	}
	cout << x + 1 << " " << y + 1 << "\n";
	return 0;
}